In audio and video applications of an Internet Protocol (IP) network, to smooth out impact brought from network transmission and implement synchronous play-out between a receiver and a transmitter, the receiver needs to temporarily store received audio and video data into a buffer in order to ensure that the audio and video data can still be played continuously after being transmitted using the IP network. A delay and a packet loss brought from a buffer need to be comprehensively considered in design of the buffer, an extremely small buffer may cause excessive packet losses, and an extremely large buffer may cause an extremely long play-out delay. It can be learned that a buffer status of the receiver directly affects audio and video play-out quality. Therefore, estimating the buffer status becomes extremely important for evaluation of the audio and video play-out quality.
The prior art mainly performs modeling for a buffer in a Real-Time Transport Protocol (RTP)/User Datagram Protocol (UDP) scenario in order to perform an operation, such as evaluating audio and video play-out quality by estimating a buffer status. At present, there are increasing audio and video applications based on the Transmission Control Protocol (TCP).
Currently, the audio and video applications of the IP network use the buffer on the receiver. The buffer may smooth out impact of a network jitter on the applications to a large extent, and therefore a representation of the buffer may reflect end-to-end performance of these applications.
To smooth out the impact brought from the network transmission and synchronize play-out between the transmitter and the receiver, the receiver needs to temporarily store the received data into the buffer. A main function of the buffer is to calculate a network jitter, and provide audio and video data according to a decoding need, and such a buffer is referred to as a de-jitter buffer, which ensures that audio and video data can still be played continuously after the network transmission. A delay and a packet loss brought from a buffer need to be comprehensively considered in design of the de-jitter buffer, an extremely small buffer may cause excessive packet losses, and an extremely large buffer may cause an extremely long play-out delay.
A terminal buffering status directly affects a result of a subjective quality evaluation, and modeling for various buffers is an indispensable step for the subjective quality evaluation.
A buffer event, such as seek, pause, resume, and stream switch, directly affects a buffering status. To update a buffer status accurately, the buffer event needs to be determined accurately.
In the prior art, the buffer event is determined using an audio/video data stream and a presentation time stamp (PTS). The pause occurs when no new audio/video data stream arrives, the resume occurs when a new audio/video data stream arrives after the pause occurs, and the seek occurs when a jump occurs on a PTS of the audio/video data stream.
In an existing method, to determine a buffer event using an audio/video data stream and a PTS, a media file needs to be parsed to obtain the PTS, which cannot be implemented or is extremely difficult to implement in real time in some cases, for example, when data is encrypted and there are mass users concurrently.